﻿using System;
using System.Collections;


using BuildingBasicDomain; 
using CommonTypes.Events;
using MVCFramework.View;

using MVCFramework.Presenter.States;
using MVCFramework.Presenter ;

namespace MVCFramework
{
    public interface IViewActionListener
    {
        bool MouseDownHandler(object sender, ActionEventArgs e);
        bool MouseMoveHandler(object sender, ActionEventArgs e);
        bool MouseUpHandler(object sender, ActionEventArgs e);

        //bool MenuItemClick(object sender, ActionEventArgs e);
    }

    public interface IPresenter  
    {
        Id<IPresenter> Id { get; set; }
        ControllState ControllState { set; get;}
        IModel Model { get;set; }
        void SetControllState(Type TypeofState);
        void SetControllState(Type TypeofState, Type Selectionstrategy);
        event EventHandler  OnSelection;
        event EventHandler OnPresenterModifidedModel;

//this belongs to a MenuHandling Component
        # region "Menu Handling Block "

        ArrayList ParseContextMenu();
        System.Collections.Generic.IList<MVCFramework.Menus.IMenuCommand> GetCommands();// rename ParseContextMenu
        void DispatchMenuEvent(MVCFramework .Menus .IMenuCommand command);
        void DispatchMenuEvent(string command);

        # endregion    

        IMainView MainView { get; set; }

        # region " View handling block"

        System.Collections.Generic.IList<IView> GetViews();
        void AddView(IView view);
        void RemoveView(IView view);
        IView GetView(string id); // Views{get ;set;}
        void NotifyViews();
        void NotifyViews<T>(Predicate<T> predicate);

     //  void drawLine(ILine  line);
     //  void drawPoint(IPoint point);
     //  void drawPlane(IPlane plane);
     //  void drawLine(IPoint point1, IPoint point2);
     //  void drawPlane(ILine line, IPoint point);
     //  void drawPlane(IPoint point1, IPoint point2, IPoint point3);
     //  void drawRect(IPoint point1, IPoint point2);

        # endregion

        # region " command handling block"

        void Undo(int numOfCommands);
        void Undo();
        void Redo(int numOfCommands);
        void Redo();

        bool RequestAddition<T>(T _object) where T : class, IModelData;
        bool RequestRemoval<T>(T _object) where T : class, IModelData;

        # endregion

        # region "Selection block"

        void DeleteSelection();
        void ClearSelection();

        # endregion

        void SetSelectedView(object sender, EventArgs e);

        # region "Testing block"

        void PresenterModifidedModelHandler(object sender, EventArgs Args);
        void PresenterTestRoutine();

        # endregion
    }

}
